<?php 

class CategoriaController extends Controller{

	private $model;
	
	public function __construct(){
		$this->model = new CategoriaModel();
	}
	
	public function buscarCategoria(){
		$result = array();
		$result['total'] 	= $this->model->getTotal();
		$result['rows'] 	= $this->model->getCategoria(TRUE);
		
		echo  json_encode($result);
	}
	
	public function adicionar(){
		var_dump(Uri::getPOST());
	}
	
	public function getCategoria(){
		echo $this->model->getCategoria();
	}
	
	public function setCategoria(){
		$id = Uri::getGET('id');
			
		echo '<pre>';
		var_dump($this->model->setCategoria($id));
	}
}

?>